package com.satan.elasticsearch.constant;

public class HotelIndexConsts {
    public static final String MAPPING_TEMPLATE = """
            {
              "mappings": {
                "properties": {
                  "id": {
                    "type": "keyword"
                  },
                  "name": {
                    "type": "text",
                    "analyzer": "ik_max_word",
                    "copy_to": "all"
                  },
                  "address": {
                    "type": "keyword",
                    "index": false
                  },
                  "price": {
                    "type": "integer"
                  },
                  "score": {
                    "type": "integer"
                  },
                  "brand": {
                    "type": "keyword",
                    "copy_to": "all"
                  },
                  "city": {
                    "type": "keyword",
                    "copy_to": "all"
                  },
                  "starName": {
                    "type": "keyword"
                  },
                  "business": {
                    "type": "keyword"
                  },
                  "location": {
                    "type": "geo_point"
                  },
                  "pic": {
                    "type": "keyword",
                    "index": false
                  },
                  "all": {
                    "type": "text",
                    "analyzer": "ik_max_word"
                  }
                }
              }
            }
            
            
            
            """;
    public static final String INDEX_TEMPLATE = """
            {
              "settings": {
                "analysis": {
                  "analyzer": {
                    "text_anlyzer": {
                      "tokenizer": "ik_max_word",
                      "filter": "py"
                    },
                    "completion_analyzer": {
                      "tokenizer": "keyword",
                      "filter": "py"
                    }
                  },
                  "filter": {
                    "py": {
                      "type": "pinyin",
                      "keep_full_pinyin": false,
                      "keep_joined_full_pinyin": true,
                      "keep_original": true,
                      "limit_first_letter_length": 16,
                      "remove_duplicated_term": true,
                      "none_chinese_pinyin_tokenize": false
                    }
                  }
                }
              },
              "mappings": {
                "properties": {
                  "id":{
                    "type": "keyword"
                  },
                  "name":{
                    "type": "text",
                    "analyzer": "text_anlyzer",
                    "search_analyzer": "ik_smart",
                    "copy_to": "all"
                  },
                  "address":{
                    "type": "keyword",
                    "index": false
                  },
                  "price":{
                    "type": "integer"
                  },
                  "score":{
                    "type": "integer"
                  },
                  "brand":{
                    "type": "keyword",
                    "copy_to": "all"
                  },
                  "city":{
                    "type": "keyword"
                  },
                  "starName":{
                    "type": "keyword"
                  },
                  "business":{
                    "type": "keyword",
                    "copy_to": "all"
                  },
                  "location":{
                    "type": "geo_point"
                  },
                  "pic":{
                    "type": "keyword",
                    "index": false
                  },
                  "all":{
                    "type": "text",
                    "analyzer": "text_anlyzer",
                    "search_analyzer": "ik_smart"
                  },
                  "suggestion":{
                    "type": "completion",
                    "analyzer": "completion_analyzer"
                  }
                }
              }
            }
            
            
            
            """;
    public static final String INDEX_NAME = "hotel";
}